package com.ycsj.goldmedalnewconcept.common.adapter;

import android.content.Context;
import android.support.annotation.Nullable;
import android.support.v7.widget.RecyclerView;
import android.view.View;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.ycsj.common.manager.BqaManager;
import com.ycsj.goldmedalnewconcept.R;
import com.ycsj.goldmedalnewconcept.common.bean.HelpInfo;

import java.util.List;

/**
 * 帮助与反馈列表适配器
 * Created by Administrator on 2018/6/20 0020.
 */

public class HelpRvAdapter extends BaseQuickAdapter<HelpInfo.DataBean, BaseViewHolder> {

    private Context context;
    private HelpItemRvAdapter adapter;
    //空视图
    private View emptyView;

    public HelpRvAdapter(Context context, int layoutResId, @Nullable List<HelpInfo.DataBean> data) {
        super(layoutResId, data);
        this.context = context;
    }

    @Override
    protected void convert(BaseViewHolder helper, final HelpInfo.DataBean item) {

        //RecyclerView
        RecyclerView rv = helper.getView(R.id.rv_item);

        emptyView = View.inflate(context, R.layout.base_rv_common_empty_view_white_bg, null);
        adapter = new HelpItemRvAdapter(context, R.layout.common_item_rv_help, item.getQa());

        BqaManager.setRv(emptyView, context, adapter, rv);
    }
}
